<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
	<script type="text/javascript">

			function jsq(rule, n1, n2) {
				switch (rule) {
					case '+':
						return n1 + n2;
						break;
					case '-':
						return n1 - n2;
						break;
					case '*':
						return n1 * n2;
						break;
					case '/':
						return n1 / n2;
						break;
				}
			}

		function qiuhe() {
			let num1 = 168,
				num2 = 66;
			let result = jsq('+', num1, num2);
			console.log('num1+num2=', result);

			let avg = jsq('/', result, 2);
			console.log('(num1+num2)/2=：', avg);

			let n1value = jsq('-', num1, avg);
			let n2value = jsq('-', num2, avg);

			console.log('(num1+num2)-num1=', n1value);
			console.log('(num1+num2)-num2=', n2value);
		}

		qiuhe();

	</script>
</html>

</script>
</html>
